use std::collections::HashMap;

fn main() {
    println!("----------------------字符串---------------------------");
    let zsw = "zsw".to_string();
    let zsw2 = "zsw2";
    let zsw3 =  "zsw3".to_string();
    let zsw_len = zsw.len();

    assert_eq!(3, zsw_len);
    let s = format!("{}, {}", zsw, zsw2);
    let s2 = zsw.to_string() + &zsw2 + &zsw3;

    println!("{0} name  is {1 } \n {2}",zsw, s, s2);

    println!("--------------------slice-----------------------------");
    let ssl = [1,2,3,4,5];
    let slice = &ssl[1..3];
    for x in slice{
        println!("{0} ",x);
    }


    println!("--------------------map-----------------------------");
    let mut map1 = HashMap::new();
    map1.insert("name1".to_string(),1);
    map1.insert("name2".to_string(),2);
    map1.insert("name3".to_string(),3);

    for (x,v) in map1 {
        println!("{},{}", x, v);
    }
    println!("--------------------vector-----------------------------");
    // let mut vv = Vec::new();
    let mut vv = vec![];
    vv.insert(0,"2");
    vv.insert(0,"1");
    vv.remove(0);
    vv.push("1");
    vv.push("2");
    vv.push("1");
    vv.push("5");
    vv.pop();
    // vv.pop();


    for x in vv {
        println!("{}", x)
    }


    
}
